<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * @author Walty (494688825@qq.com)
 * @version  ArticleCategoryManager 1.0 (2016-10-23)
 * C层  自有类，提供所有类的共有方法
 * 主要功能：
 * 1、changeSafeData 数据安全化
 * 2、showErro 数据错误显示
 * */
abstract class MY_Controller extends CI_Controller{
	public function __construct(){
		parent::__construct();	
	}
	
	protected function sucJson($data){
		$this->showJson('200',$data,null);
	}
	
	protected function errJson($msg){
		$this->showJson('400',null,$msg);
	}
	
	protected function showJson($code,$data,$msg){
		$json['code'] = $code;
		$json['data'] = $data;
		$json['msg'] = $msg;
		echo json_encode($json);
		
	}

}

?>